Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup texmanager. #10181

Merged
merged 1 commit into from Jan 8, 2018
Merged

Cleanup texmanager. #10181

merged 1 commit into from Jan 8, 2018

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jan 6, 2018

  • remove check for "old" cache (the location changed in efa9ea6 (2005)).
  • postscriptd and pscnt are unused since c0d6110 (2006), deprecate them.
  • calling \usepackage more than once with the same package does nothing
    (as a repeated import in Python) so no need to remove calls to
    \usepackage{type1cm}.
  • replace DEBUG by _log.debug where appropriate; other cases (forcing
    file regeneration) can be handled by manually deleting the old file.

Various other minor cleanups.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer force-pushed the cleanup-texmanager branch 2 times, most recently from bfd122c to 92b1bb4 Compare January 6, 2018 22:03
@tacaswell
Copy link
Member

get_ps_bbox was last used in 310e707 (2009)

@tacaswell tacaswell added this to the v2.2 milestone Jan 7, 2018
@tacaswell
Copy link
Member

It looks like DEBUG used to also short-circuit the cache and force re-generation in all cases. I don't think that is a big deal, but just making sure it is noted.

break
else:
if DEBUG:
print('$s font is not compatible with usetex')
_log.debug('$s font is not compatible with usetex')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a $s font? Was this supposed to be a %s substitution?


def get_basefile(self, tex, fontsize, dpi=None):
"""
returns a filename based on a hash of the string, fontsize, and dpi
Returns a filename based on a hash of the string, fontsize, and dpi.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you're changing them all, the first line of the docstring should be imperative (Return, not Returns).

- remove check for "old" cache (the location changed in efa9ea6 (2005)).
- postscriptd and pscnt are unused since c0d6110 (2006), deprecate them.
- make_ps and make_ps_bbox are unused since 310e707 (2009), deprecate
  them.
- calling \usepackage more than once with the same package does nothing
  (as a repeated import in Python) so no need to remove calls to
  \usepackage{type1cm}.
- replace DEBUG by _log.debug where appropriate; other cases (forcing
  file regeneration) can be handled by manually deleting the old file.

Various other minor cleanups.
@anntzer
Copy link
Contributor Author

anntzer commented Jan 8, 2018

all comments are handled

@QuLogic QuLogic merged commit e219883 into matplotlib:master Jan 8, 2018
@anntzer anntzer deleted the cleanup-texmanager branch January 9, 2018 01:19
@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants